/*
-- =============================================
-- Author:			Jacqueline Walton
-- Create date:		March 27, 2014
-- Description:		Check the date a database table was last updated
-- Last Updated:	March 27, 2014

-- License and Permissions
					 *     https://crystaltest.codeplex.com
					 *
					 * Distributed in whole under the terms of the Apache 2.0 License
					 *
					 *     Copyright 2014, Pixeltrix
					 *
					 * Licensed under the GNU General Public License version 2 (GPLv2) (the "License");
					 * you may not use this file except in compliance with the License.
					 * You may obtain a copy of the License at
					 * 
					 *     https://crystaltest.codeplex.com/license
					 * 
					 * Unless required by applicable law or agreed to in writing, software
					 * distributed under the License is distributed on an "AS IS" BASIS,
					 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
					 * See the License for the specific language governing permissions and
					 * limitations under the License.
					 *
					 *     Date: Fri Mar 28 2014 09:33:33 -0500
-- =============================================
*/

SELECT OBJECT_NAME(OBJECT_ID) AS DatabaseName, last_user_update,*
FROM sys.dm_db_index_usage_stats
WHERE database_id = DB_ID( 'DatabaseName')
AND OBJECT_ID=OBJECT_ID('TableName')